import { createRouter, createWebHistory,type RouteRecordRaw, type Router } from 'vue-router'


const routes: Array<RouteRecordRaw> = [
    // 首页
    {
        name: "home",
        path: "/",
        component: () => import("@/views/HomeView.vue")
    },
    // 简历页面
    {
        name: "resume",
        path: "/resume",
        component: () => import("@/views/MyResume.vue")
    },
    // 关于页面
    {
        name: "about",
        path: "/about",
        component: () => import("@/views/AboutView.vue")
    }
];

const router: Router = createRouter({
    routes,
    history: createWebHistory(),
    // 滚动条到顶部
    scrollBehavior() {
        return { top: 0 }
    }
});

// eslint-disable-next-line
router.beforeEach((to, from) => {
    // do something
    return;
});

export default router;
